package org.example.everyday;

public class Lc1374 {
    public static void main(String[] args) {
        Lc1374 lc1374 = new Lc1374();
        String res = lc1374.generateTheString(4);
        System.out.println(res);
    }


    public String generateTheString(int n) {
        StringBuffer sb = new StringBuffer();
        if (n % 2 == 1) {
            return sb.append(repeat("a",n)).toString();
        }
        return sb.append(repeat("a",n - 1)).append("b").toString();
    }

    private String repeat(String a,int n){
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < n; i++) {
            sb.append(a);
        }
        return sb.toString();
    }
}
